package com.cy.jt.sso.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 木木
 * @Email 1194660762@qq.com
 * @date 2021-07-26 9:45
 */

@RestController
public class ResourceController {
    @PreAuthorize("hasAuthority('sys:res:create')")
    @RequestMapping("/doCreate")
    public String doCreate() {
        return "create ok";
    }

    @PreAuthorize("hasAuthority('sys:res:retrieve')")
    @RequestMapping("doRetrieve")
    public String doRetrieve() {
        return "retrieve ok";
    }

    @PreAuthorize("hasAuthority('sys:res:delete')")
    @RequestMapping("doDelete")
    public String doDelete() {
        return "delete ok";
    }

    @PreAuthorize("hasAuthority('sys:res:update')")
    @RequestMapping("doUpdate")
    public String doUpdate() {
        return "update ok";
    }
}
